

<script>
    $(function() {
        $( "#accordion" ).accordion({
            collapsible: true
        });
    });
</script>
<?php if(isset($latest_news)){  ?>
<div class="main_content">
    <div class="main_content_head">
        <div class="main_content_head_tab_left"></div>
        <div class="main_content_head_tab_content">Tin tức</div>
        <div class="main_content_head_tab_right_content"></div>
        <div class="main_content_head_tab_right_middle"></div>
        <div class="main_content_head_tab_right_end"></div>
    </div>
    <?php $date = date_create($latest_news->news_date); ?>
    <div id="news">
        <br/>
        <p id="news-title"><?= $latest_news->news_title ?></p>
        <p id="news-date">Ngày đăng: <?= date_format($date, 'd/m/Y'); ?></p>
        <p id="news-author">Đăng bởi: <?= $latest_news->news_author ?></p>
        <p id="news-short-content"><?= $latest_news->news_short_content ?></p>
        <p id="news-main-content"><?= $latest_news->news_content ?></p>

        <p id="news-source">Nguồn: <?= $latest_news->news_source ?></p>
    </div>
    <div id="accordion">
        <h3 style="font-family: tahoma; font-weight: bold;">Tin tức cũ hơn</h3>
        <div>
            <ol id="older-news-ul">
                <?php foreach ($all_news as $row) : ?>

                    <li>
                        <a href="<?= HOME_PAGE ?>news/details/<?= $row->news_id ?>"> 
                            <?= $row->news_title ?>
                        </a>
                    </li> 
                <?php endforeach; ?>
            </ol>

        </div>


    </div>


</div>
<?php } else echo '<center><h1>Chưa có tin tức nào</h1></center>'; ?>